package gov.pbc.gx.nn.pz.bdf.entity;

import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.bstek.bdf2.core.business.IDept;
import com.bstek.bdf2.core.business.IUser;
import com.bstek.dorado.annotation.PropertyDef;

@Entity
@Table(name = "T_DEPT")
public class Dept implements IDept, java.io.Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name = "ID_", length = 60)
	@PropertyDef(label = "ID")
	private String id;
	@PropertyDef(label = "部门名称")
	@Column(name = "NAME_", length = 60)
	private String name;
	@PropertyDef(label = "备注")
	@Column(name = "DESC_", length = 120)
	private String desc;
	@PropertyDef(label = "公司ID")
	@Column(name = "COMPANY_ID_", length = 60)
	private String companyId;
	@PropertyDef(label = "创建日期")
	@Column(name = "CREATE_DATE_")
	private Date createDate;
	@PropertyDef(label = "上级ID")
	@Column(name = "PARENT_ID_", length = 60)
	private String parentId;
	@PropertyDef(label = "编码")
	@Column(name = "CODE_", length = 30)
	private String code;
	@PropertyDef(label = "类型", description = "0：机构1：部门")
	@Column(name = "TYPE_")
	private int type;
	@PropertyDef(label = "序号")
	@Column(name = "ORDER_")
	private int order;
	@PropertyDef(label = "级别")
	@Column(name = "KIND_")
	private int kind;

	@Transient
	private IDept parent;
	@Transient
	private List<IUser> users;
	@Transient
	private List<IDept> children;

	@Override
	public String getCompanyId() {
		// TODO Auto-generated method stub
		return companyId;
	}

	@Override
	public String getId() {
		// TODO Auto-generated method stub
		return id;
	}

	@Override
	public String getName() {
		// TODO Auto-generated method stub
		return name;
	}

	@Override
	public String getParentId() {
		// TODO Auto-generated method stub
		return parentId;
	}

	@Override
	public IDept getParent() {
		// TODO Auto-generated method stub
		return parent;
	}

	@Override
	public List<IUser> getUsers() {
		// TODO Auto-generated method stub
		return users;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public List<IDept> getChildren() {
		return children;
	}

	public void setChildren(List<IDept> children) {
		this.children = children;
	}

	public void setId(String id) {
		this.id = id;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void setCompanyId(String companyId) {
		this.companyId = companyId;
	}

	public void setParentId(String parentId) {
		this.parentId = parentId;
	}

	public void setParent(IDept parent) {
		this.parent = parent;
	}

	public void setUsers(List<IUser> users) {
		this.users = users;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	public int getOrder() {
		return order;
	}

	public void setOrder(int order) {
		this.order = order;
	}

	public int getKind() {
		return kind;
	}

	public void setKind(int kind) {
		this.kind = kind;
	}
	

}
